package cn.zzszxyy.hr.model;

import javax.persistence.*;
import java.util.Date;

/**
 * 作者:张伟
 * <p>
 * 联系:adamzzww@163.com
 * 时间:2016-11-26
 * 说明:用户信息表
 */
@Entity
@Table(name = "Users")
public class UserEntity extends ModelEx {

    private Integer userId;
    private String userName;
    private String loginName;
    private String userPwd;
    private String userPhone;

    private RoleEntity role;
    private DepartmentEntity dept;
    private JobTitleEntity jobTitle;

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

    public String getLoginName() {
        return loginName;
    }

    public void setLoginName(String loginName) {
        this.loginName = loginName;
    }

    public String getUserPwd() {
        return userPwd;
    }

    public void setUserPwd(String userPwd) {
        this.userPwd = userPwd;
    }

    public String getUserPhone() {
        return userPhone;
    }

    public void setUserPhone(String userPhone) {
        this.userPhone = userPhone;
    }

    @OneToOne
    @JoinColumn(name = "roleId", referencedColumnName = "roleId")
    public RoleEntity getRole() {
        return role;
    }

    public void setRole(RoleEntity role) {
        this.role = role;
    }

    @OneToOne
    @JoinColumn(name = "deptId", referencedColumnName = "deptId")
    public DepartmentEntity getDept() {
        return dept;
    }

    public void setDept(DepartmentEntity dept) {
        this.dept = dept;
    }

    @OneToOne
    @JoinColumn(name = "titleId", referencedColumnName = "titleId")
    public JobTitleEntity getJobTitle() {
        return jobTitle;
    }

    public void setJobTitle(JobTitleEntity jobTitle) {
        this.jobTitle = jobTitle;
    }
}
